<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ page import="java.sql.*"%>

<%
	Connection conn = null;

	String driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
	String url = "jdbc:sqlserver://painhealer.cafe24.com:1433/painhealer";

	Boolean connect = false;

	try {
		Class.forName(driver);
		conn = DriverManager.getConnection(url, "painhealer", "1q2w3e4r");

		connect = true;

		conn.close();
	} catch (Exception e) {
		connect = false;
		e.printStackTrace();
	}
%>
<html>
<head>
<title>JDBC 연동 테스트 예제</title>
</head>
<body>
	<h3>
		<%
			if (connect == true) {
		%>
		연결되었습니다.
		<%
			} else {
		%>
		연결에 실패하였습니다.
		<%
			}
		%>
	</h3>
</body>
</html>

